﻿using System;
using Habanero.Base;

namespace FireStarter.Base.BusinessObjectMerger
{
    public interface IMergeBO
    {
        IMergableBo MergeBOFrom(IMergableBo fromBO, IMergableBo toBO);
        IMergableBo FindBusinessObject(IBusinessObjectCollection businessObjectCollection, IMergableBo boToFind);
        /// <summary>
        /// Creates a Business Object of the required type and sets its pending item status to <see cref="ChangeType.Add"/>
        /// </summary>
        /// <returns></returns>
        IMergableBo CreateBusinessObject();
        void UpdatePendingChangeType(IMergableBo parent);
        CompareResult CompareBusinessObjects(IMergableBo x, IMergableBo y);
    }

    /// <summary>
    /// This 
    /// </summary>
    public interface IMergeBO<T> : IMergeBO where T : class, IMergableBo
    {
        T MergeBOFrom(T fromBO, T toBO);
        new T CreateBusinessObject();
        void UpdatePendingChangeType(T parent);

        CompareResult CompareBusinessObjects(T x, T y);
    }
}